import asyncpg
import asyncio

async def fetch_data():
    # 创建数据库连接池
    pool = await asyncpg.create_pool(user='postgres',
                                     password='A7#mZ9!pL3$q',
                                     host='localhost',
                                     port=5433, database='vectorTest')

    async with pool.acquire() as conn:
        rows = await conn.fetch('select * from my_embeddings limit 5')
        for row in rows:
            print(row)

    await pool.close()

# 运行协程
asyncio.run(fetch_data())